﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Timers;
using BoxLogging;

namespace GVCSMTemplates
{
    public partial class GVPlazaSession : System.Web.UI.Page
    {
        int t = 0;
        String directory = "c:";
        String fileLocation = "c:/test.txt";
        private static System.Timers.Timer timer1 = new System.Timers.Timer();
        private static System.Timers.Timer timer2 = new System.Timers.Timer();
        protected void Page_Load(object sender, EventArgs e)
        {
            timer1.Interval = 30 * 1000;
            timer1.Start();
            timer1.Enabled = true;
            //timer1.Elapsed += new System.Timers.EventHandler(timer1_Tick);
            //Literal12.Text = "<div class='Imageslideshow'>";
            //Literal12.Text = "<div class='MovieImageForThreeScreenFrame'>";
            //testMethod();
            //timer1.Interval = 30 * 1000;
            //timer2.Interval = 20 * 1000;
            //timer1.Tick += new EventHandler(timer1_Tick);
            //timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Tick);
            //timer1.Start();
            //timer1.Enabled = true;
            //timer1.Elapsed += new System.Timers.EventHandler(timer1_Tick);
            //timer1.Enabled = true;
            //timer2.Elapsed += new System.Timers.ElapsedEventHandler(timer2_Tick);
            //timer2.Enabled = true;
            //timer2.Stop();
        }

        //public void timer1_Tick(object sender, EventArgs e)
        //{
        //    String test12= "<div class='BackgroundImage'><div class='Imageslideshow'><!-- Background Image for the Session Template--><img src=\"Images/PlazaSession1.jpg\" /></div> </div>";
        //    TestLiteral1.Text = test12.ToString();
        //    timer1.Stop();
        //    timer2.Start();
        //}

        //public void timer2_Tick(object sender, EventArgs e)
        //{
        //    String test13 = "<div class='BackgroundImage'><div class='Imageslideshow'><!-- Background Image for the Session Template--><img src=\"Images/PlazaSession2.jpg\" /></div> </div>";
        //    TestLiteral1.Text = test13.ToString();
        //    timer1.Start();
        //    timer2.Stop();
        //}

        public String testMethod()
        {
           
            if (t == 0)
            {
                string tt = "<div class='BackgroundImage'><div class='Imageslideshow'><!-- Background Image for the Session Template--><img src=\"Images/PlazaSession1.jpg\" /></div> </div>";
                //TestLiteral1.Text = tt.ToString();
                t = 1;
                BoxLogging.BoxLogging.WriteSimpleLog("Plasma Session Template 1", directory, fileLocation);
                return tt.ToString();
            }
            else
            {
                string tt1 = "<div class='BackgroundImage'><div class='Imageslideshow'><!-- Background Image for the Session Template--><img src=\"Images/PlazaSession2.jpg\" /></div> </div>";
                //TestLiteral1.Text = tt1.ToString();
                t = 0;
                BoxLogging.BoxLogging.WriteSimpleLog("Plasma Session Template 2", directory, fileLocation);
                return tt1.ToString();
               
            }

            }



    }
}